Revert README and buffer allocation changes.
Improve and comment unit test.
Make exception more precise.