Fix type generalizer bug