Bugfixes for prev/next buttons