Adjust to handle 404 inside generators

basically abuse try:except:else blocks to get the desired results.

this can probably be abstracted away, but given the context I
didn't bother

Also, needed to trap IOError