Palletizing in subprograms causes null pointers