Improve error checks in Extract task