Fix memory alignment issue