Report last error in closing methods

When there are multiple errors around closing methods, report the
last error instead of the original.
5 files changed