FIX: Make testing slightly cleaner

This does not fix the problems in `master`, but it should make them easier to diagnose. Ready for review/merge from my end. 
This code appears several more times in a few different files.. did you intend to only remove it here?