fix a couple of bugs with modulation found in initial testing