Fix bug with the order of activities (introduced with ab24bf7e9bb9).