Fix tests

see commit messages for more