sundry bug fixes with file creation