appendChild type changed.

Sometimes head element could be missing. In that case that script could break out. Now it just searches the first element and than appends it-self.

More: http://www.stevesouders.com/blog/2010/05/11/appendchild-vs-insertbefore/