A build fix and packaging updates for mingw build