Fixing recursive function calls.