Corrected pattern match