Fixed bug causing tests to fail