$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 no units was being outputted to the frontend and to the compiler.