Fixed bug in recurse() function causing recursion to fail.