Fix conditional restart and regexp