Fixed some recursion issues