Fixed frame_ticks calculation and added bounds check for init_pts