Fix tests, one bug