cfg fixes for type checker