Added error handling for 'open'
Improved default options and logging