Fixed bugs in handling of random numbers in CustomIntegrator (see bug 18...

Fixed bugs in handling of random numbers in CustomIntegrator