Fixes for MinGW compile