Handle nil case.
Fix build error in unit test
Use implementation from README.
Handle string parsing and add more test cases.