style tweaks
fixup docId in scope
clear docId from state if it is the default one