This should not belong here.. It belongs to the extract function.. I'm not sure we should throw an error though.