fix construction of masked array