corrected quad type detection