bugfixes and more improvements on the cli