fix #items_before and #prev