Fix testcase to actually check what it was supposed to, and make it a bit more robust.