Fixed for ST3 compatibility

With these changes it works with ST3 also
Merge pull request #21 from quarnster/patch-1

Fixed for ST3 compatibility