Added logical indexing to subarrays. Fix #4763
Backport fix #6036

From @timholy 40fdf3eb6d49e30cdd3c47e1184a467cc1fc04ab
Merge pull request #6047 from ivarne/release-0.2

Backport some fixes for release-0.2 branch