bug fixes according to tester.py