more tests, fixed a bug