Change im.set_state() to accept null