Fixed monkey-patching persistent state bug.