Added code needed to restore the values of the lifecycle callback invocation counters