Add extra check to avoid models segfaults

Keep debug on for now...