more debugs and various fixes for ming