Improve documentation, warnings, and fix a few regressions