Correct unique for empty arrays

Only return properties belonging to output object. Fixes bug where [].unique() evaluates to [null]