Fixed IOError on writes to a closed file, replaced unittest with pytest
and added a default to freaker.