fixes to be able to specify the directory.