Some compatibility fixes for cross-compiling
Why? Because I can!