Fix stuttering bug in Firefox