Fixed an infinite recursion bug