fixed small bug that caused unit tests to fail in certain situations