[Bug 37478] cmd doesn't handle "else if" correctly in all cases