fix errors and update docs