Revert "remove NewIfChange and other fixes"

This reverts commit 4f6f90a1ecc2c987fe1f3808b42acb3b8b12fab5.