Simplify pmatch and in-place