Rewrote tests for Python 3