properly flatten null values

When a `null` value is flattened, it will recurse and call foreach() on it, which will yield a warning.

This fix flattens them as _\<null\>_