Recursion fix

Critical bug fixes