Add tox and fix failing tests