Fixed. Weird that the unit test cases pass. Maybe because it runs too fast?