$modx->getSettings() Bug fix and refactor
Small fix
Refactor $modx->getDocumentObject()