Fix for command/reply and improved PrettyPrint