Add a small test suite

and fix a bug with python 2.7