Fixed performance bug in tests.