Fixed bugs on test.py