typecheck: switch to using only unifyWithOverrideM
typecheck: fix loop bug