Fixed wrong choice of previous_i_entry