Misc additions to directory and command line utils