Closes #190 - Fix all potential resource leaks

Pull request for #190
not sure about closing FileSystem object... if its shared among threads, could impact other threads... maybe does not matter for this case.