New tests and fix error messages