Make dir() a bit saner

Alas, it doesn't fix panda just yet