Corrected code errors
Added CreateDirectory
more test code