Fix mkdir and a couple other issues.