MFC r273770:
Fix build after previous commit. While here, improve error messages.
Sponsored by: The FreeBSD Foundation