Fixed empty pattern matching bug