Fix promise state tracking and compliance stats.
(cherry picked from commit 4445945560aca14b118369ad15f5058c418349aa)