Make error messages more specific to the case that throws the error