Fix ref contract