removing whitespace, adding additional error reporting levels
various improvements