Debugging, made some error messages clearer