More unit tests, more bug fixes. Recursion works properly now