Minor changes for review comments, fix VC++ compilation