Final bits of documentation and code tweaking