Merge pull request #190 from harmjanwestra/master

Small fixes and code cleanup
This is a fix for an issue that happens in some JVMs (like mine) when combining BufferedOutputStream with FileOutputStream.