Novak Djokovic survived a sluggish start and a final set wobble to take his place in the third round of the Monte Carlo Masters.