Made cleanup run even in event of failure.

If cleanup itself fails it produces a different error.