Fixed infinite-recursion bug