Fix undefined offset error

Fix #23
Merge branch '1.0'