Fixed DOM compatibility for Firefox