[MacOSX] Fixed recursion and removed debug printf's