offset now works correct, by replacing #pos to #charpos in source.rb:41