added codes to MonteCarloEngine::Initialize() for error detection.