Fix tests

The commits should be self-explanatory.