Fix fact counter and cleanup.