Two minor optimizations to test functions.