Bugfixes to CLI utilities