Fix UD define, improve result formatting