Fix SQL grammar for acks