Fixing some important bugs in the Legion runtime and updating some tools