Cleaning up waveformplot code.