Error code was not initialised to zero before printing.
This could lead to infinite loops when extracting error message from status codes.
Fixed some errors in a docstring