Documentation and code tweaks