stockpiles: backport fixes