Added context replacement for comma-separated rules