Added error messages that should make it easier to tell if certain directories have not been created. Also checks that files are actually created and written at each step of the process. --Mike
Changed paths: