obj2map blows the stack. new version with level limit