Added parsing of a target directory parameter