Update plugin and remove a bug

Hey,

I just updated the plugin and removed a bug. 
See commits for detailed explanation.