Make get_all_states() not segfault every time.