Fixing bug with next/previous link building.