fixed errors in test()