Merge "Merge transactions to parent if layer is going to be removed." into pi-dev