Added better handling for PatternSyntaxExceptions