Merge pull request #43 from dnajd/master

fixing offset bugs