Fix offset optimizing issue introduced by padding char (#398).
Merge pull request #406 from duanyao/fix_offset_and_padding

Fix offset optimizing issue introduced by padding char (#398).