restore to a usable state
fix warnings