Fix get next and previous entries