Bug fixes and performance improvements to the legion runtime