Fixed glm::mask function and tests