Adapted footer to be printed in error case, too.