Generalised "replica"-method for computing S_d.
Corrected value of S_d(0): now 0.

In this way also the replica-computation could be simplified.