Fix jQuery errors in Firefox