Fix bug in case reification, now with variable checking.