Some cleaning up and reporting detected errors correctly