A few fixes

Hi, I made a few fixes to the plugin to make it work for me.