Fix to the previous commit, that wasn't handling dir operations right