Error reporting was sometimes incorrect and incomplete

This incompleteness check should be factored out into a separate function for clarity.