fixed a bug in run-test
fixed tests a bit more