Fixed model toposort