Fix state ordering