added some error checking to lib/extract...