Fixed bug causing test failures.