fix merging in valid data into masked data.

checking of equality has to be done differently to respect the special
cases involved with masked data.