Fixed issues with CreateDir and ParentPath functions