More fixes for cross-platform support.