Fix error check in extract.c