Updates to plugin structure and minor fixes