Added a slight performance improvement.
Fixed a test failure.