Fixed pointer bug in recursive subrountines.