Merge pull request #33 from pengwk/add-value-boundary-check

Add value boundary check.