- added error handling to writeTable so that a proper exception is raised (instead of warning) when temporary file cannot be opened
- temporary file is now closed in writeTable so that it can be deleted