Fixes to CLI scripts