Some memory alignment fixes