MinGW compilation fixes