Fix allocation error