Adjusted the test function to be a little smarter than it was.