Fix offset calculation bug
Merge pull request #80 from alancutter/fixOffsetRecurse

Fix offset calculation bug