fix docblocks
fix typos and deprected error handling