Fixes a bug re: previous/next