Add return codes.
Add tests for length boundary cases.
Pass length boundary test cases.