Applied checkdoc, fixed lexical-binding declaration etc