Fix endless loop with cli parameters