a few small changes to stim generation code