Fix comparing rp logic