Fix bug which was stopping plugin from working altogether