Fix branch mess brought by incorrect directory mode