Masks should be of correct dtype.