typo
add safety checks against buffer boundaries

fixes #7
bump version