Fix documentation
Fix opts hash initialization
Add unit test