Fixes #59: incorrect processing of dirs in paths