Fixed directory listing so that contents are sorted, so directories come first