Fixed a bug in RG