Final fixes to code and docs