Extract follow logic to analyzer_follow. Fix hanging in rand_int.