Sort assets before writing

Fix build 26.