Changed filter method to create proper indexes in resulting collection

`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.