Added more cross platform specific code