Minor bug fix in when --non-interactive