More tests and a bit of PEP8 fixes