Fixed tests, added pypy to travis.yml.
Fixes and logging improvements.