Small WaveManager fix and leak fix