Fix exception when using state res v2 algorithm