Fixed SPR-11897, in a way that does not harm the feature (?) of parsing key=value in the pre-matrix part of the path as though it was a matrix variable + added test to validate that scenario