FIX: more robust when optfile is not readable