Added primitive path finding. Fixed exception problem