Merge pull request #50 from raffazizzi/master

Improved parent locator code
another small improvement to parent detection