Improved logic for selecting a platform to better deal with exceptions in context initialization
Merged changes between repositories by hand