Improved multiplatform support

Change-Id: I24f019f15dc02a8c520cdf881eb917f5cb813c17