Some docs and unit tests; tweaks