Fixing tests for python 2 and making tests slightly faster