Fixed the issue with the plugins directory not being properly set in CLI mode (closes #406).