Improved logic for selecting a platform to better deal with exceptions in context initialization