Fix deletion of current level element from path