Fixed a waveform bug