Add documentation and other small tweaks