Changed filter method for proper indexes

`array_filter` messes up the indices of the resulting array, and the new collection being formed using that method would've had messed up indices. Wrapping the `array_filter` call in `array_values` would solve this issue.