Removed multiple calls to _getpath