Add tests for commands/utils and fix a round bug