Strip nulls from simplified objects

The current code was allowing through null objects in the $data property,
and also had an insufficiently strict condition in the properties, which
would have filtered out false variables. It is possible that this change
may need to be tweaked, but I think it covers the primary cases.