Make tests pass again, add tests