Closes #190 - Fix all potential resource leaks

Pull request for #190
why change this to log an error instead of throw an exception?  Stack traces are useful.