Adds a filter that removes undefined values.