Fixed encoding issues
Provide return values of the correct type where possible
More things to document
Added related work