    function _updateEmissions() internal {
        if (block.timestamp > endRewardTime()) {
            _massUpdatePools();
@>          lastRPS = rewardsPerSecond;
@>          rewardsPerSecond = 0;
            return;
        }
        setScheduledRewardsPerSecond();
    }
    function registerRewardDeposit(uint256 _amount) external onlyOwner {
        depositedRewards = depositedRewards + _amount;
        _massUpdatePools();
        if (rewardsPerSecond == 0 && lastRPS > 0) {
@>          rewardsPerSecond = lastRPS;
        }
        emit RewardDeposit(_amount);
    }
    function _updateEmissions() internal {
        if (block.timestamp > endRewardTime()) {
            _massUpdatePools();
-           lastRPS = rewardsPerSecond;
+           if (rewardsPerSecond != 0) {
+               lastRPS = rewardsPerSecond;
+           }
            rewardsPerSecond = 0;
            return;
        }
        setScheduledRewardsPerSecond();
    }
