Some minor cleaning up [ci skip].
Fixed the issue with the plugins directory not being properly set in CLI mode (closes #406).