Fix ordering bug
Bug fixes