fixed offset bugs
merge
Merge pull request #43 from dnajd/master

fixing offset bugs