[WIP] Fix tests

THIS IS NOT FINISHED YET :)
Fixes test mentioned in #699. That one must be merged first!