core: Use assert before failure exit.