Small update

Some formatting, some error handling, file creation fix