Some work for embedded integration and fixes for mingw32