Fix up the ls command a bit.

This is enspired from a commit by november-kilo.  It could maybe
use some additional clean up but I think its a little cleaner this way.