value flow: improved handling of loops