added the tests to setup.py and fixed some small bugs in the test suite