Improved context replacement algorithm and comma-separated rules processing.