Improved argument handeling for directories
no longer required to be first and multiple directories are possible.