Updated cav-hq code.