Clean up and bug fix in Sound.getLength.