Add missing files to VS build, make explicit cast.