Clean up error messages and fix tests to match them