Added \r escape to end commands, as specifications require.