Fixed some bug in test suite