Added directory parameter.