bugfix in integrate2d for wrong mask calculation