fix a few bugs with detecting that we are still in documentation