Fixed tests and error messages