made pre-commit run tests - and fixed code too