Fix for null, zero, and missing values

There were some bugs in the attribute stuff with missing / null values. This fixes them.