commands: Ensure command output is correct type (if cmd.Type is set), resolves #321