small improvements to emulation layer, usage of platform.h