Add some doctests
Fix error codes
Bump version