Fixed a few platform related issues.