Fixes for cross-platform compilation