Fixed some platform specific issues.