Corrected variance (Thanks Thomas) and added tests for inverseCumulativeProbability