Reverted back to the initial computation of R2 (more efficient).
Corrected a mistake in R2 histogram plotting.