added check for empty patches and curves in cExtract (thanks to M. Friess for pointing that out)