by slashrsm: Move debug check higher.