Bugfix

Moved the instantiation of the FileOutputStream that was causing
NullPointerException when the file was already created.