Fix shell loop