Fix "NoneType" has no attr 'get' on subdocumments