Fix a few CLI bugs (doesn't work yet with dynamic module list),
stub_parent() implementations for non-GUI mode should be merged.