Fix for Trac #564, crash when attempting to set invalid units for ungridded aggregation.