This commit has been reported to cause distortions in phoneme pitches and speeds.
Also use size_t instead of int in some places where it make sense