add option to flatten namespaces
fixed CLI return value not set