Correctly pattern match instead of '.' access