fixed some python 3.3 compatibility issues and a few more tests
fixed a bug common to both python 2 and 3 but only shows in python 3