Fix three bugs in the last commit and document special cases. Tighten