Committing before refactoring to try to deal with recursion.
Recursion bug fixed, but not ideal. May try to make it better.