Fix platform detection in tests