Fixed a subtle ordering bug