Smarter cnd, fix type stack