Document, relax checks, fix shadowed variables