fixed mkdir and ls to support all currently known cases