Added mask array operations and improved test coverage.