Fix sine wave generation.