Fix doc-o
Build fix for err type
Fix some type cases
Improved documentation