Fixing Platform Detection Code