Fix MatrixParam handling. Some formatting.

Currently matrix params are only removed if 1. they are part of the last path section and 2. there are no query params.
With this fix all matrix params on every path segment are removed.
Also some syntax stuff.