Tidied up tests and error messages