Improved platform support
Merge pull request #516 from dlsniper/improve-platform-detection

Improved platform support