Fixed nested match statement detection