Added support for boolean matrix indexing (Fixes #2677)