Fix unstable tests

@wpoely86: I *think* this should fix the occasionally failing tests (cfr. #982), please review.