Few fixes to Function 3AC gen algo