Fix for off by one errors
Merge pull request #1 from dschenkelman/master

Fix for off by one errors in link generation