Slight improvement to sound handling code when loading sounds.