Re-factored test counting.