Workaround for interruptions

Basically check it before we start and restore it when we're done.