Add tests for sorted filtered array
Fix issue with sorted filtered array