fixed applyTableChanges for tables containing NAs