Merge "Prevent IndexOutOfBoundsException while removing activities" into tm-qpr-dev