Make control flow clearer.
Fix missing rename of function call.
Count tests beforehand instead of done_testing and fix early termination.