Fixed recursion depth counting. All unit tests are passing now!