Fixes JavaScript error

(which was caused by not passing the required second argument to `insertBefore`)
Merge pull request #54 from Scotchester/master

Fixes JavaScript error