$units in output method was using the wrong array

$units was using value object instead of fields object to output the units. The result was that there was no unit output to the frontend and compiler function.