Fixed bad check for alignment and added padding uint32 to fix the root cause.