Fix rating management and cleanup