Refactored (and fixed btw) the test a lot.