Fix HDL generation of offset and shift.