Refactoring MERIT to use the plugin.
Merged fixes from fieldcapture/master.