Fix for JS not always getting included on the page, with SMW 1.9+

Change-Id: I0ef6e4718697039b64072ac5133ee48693ab0368