Fixes prev/next buttons.