Fix an assert which can be hit in gsharedvt mode. Fix a warning.