Cleaned up the CustomWaveViewer - seems to work fine now