Add tox and fix tests