Fix rule cloning bug. close #24 #22