Tons of small fixes in test routines.