Make middleware more idempotent.
Minor README changes.