Fix tests, will refactor later