Clarified the diagnosticsEnabled variable behavior and added more pattern-oriented comments.