City, HFD reach deal over contracts