Fixed error message and test