Fixed some idiot mistakes that prevented this from working in Firefox...