add tests and fix error messages