Fix data type for mask