Added additional checking in helpers for loading intermediat state. I don't know if I'm doing this right.