Fix apo_offset and add size func