fix errors and warnings with mingw
Merge pull request #250 from anyc/testing

fix errors and warnings with mingw