Raise runtime exception instead of cassert abort.

Invalid or missing files should just raise exception.
cassert should be used for code logic.