Added back the check for safari before checking target.nodeType, IE fails otherwise