Fixed bug with incorrect sort order for layout of text after reloading a project