Some fixes on the plugin.

This fixes are from a few users complaints that they can't use the plugin correctly. See commit log for details.