Add validation and some fixes.
Add readme docs.