Cleaned up error messages and codes. Also simplified some behavior, partly for better tooling support. Removed some `@covers` annotations in tests.