Fix reference to 'state' with '_state' or 'state'.