Adjust sound effect logic.
Fix a crash.