Variations in the period of the sunspot cycle