Move has_ag and has_ack before they're used.