Removed superfluous cast.
Fixed MinGW detection.