better error logging, fix docs & typos