Add support for optional plugins, minor fixups