Code tweaks and small fixes
Update documentation to fit new code