Fixed memory alignment issues in store and load functions