Merge "Revert "Revert "Fix wp and sp comparison bugs"""