Fixed a small bug in ECFactory.