Bug fix in getparent