improved exception message
Fixed test bug