small API changes
Add E_RANGE
Add test for error
Add access methods for buffer