Kill $dir for gooooooooooooood

Also fixed a couple other minor, irrelevant code style thingies which were
annoying me

Change-Id: Ibd9937ccc24500cd362f61a7c19442c793908698