Fix bug with mock modify_state