fixed bugs in wavesim