Fix for incorrect number of pagelinks when current page < 3

When current page was 1 or 2, the number of links would be one to much.
Added some missing semicolons to shut up jslint.