fixed bug in test
improved error msg