Nitpicking the code

Minor changes here and there to remove warnings and make code cleaner and more uniform.
[Eclipse](http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-avoiding_resource_leaks.htm) pointed out that some of the other methods in the class are not closing streams.