It might be good to explain slightly more why this is necessary.

    // These should be unset when a checkpoint is deserialized, otherwise the SparkContext won't initialize correctly.