test and fix command printing