Work around some exceptions on app close..