Trouble flares after Jakarta rally ends in agreement