Code cleaning to ss_gen_frame(), that will help in fixing #1048.