Fix K+R reverse optimization bug