Endian optimization bugfix to model.c