Fix bugs with Type and ValueBase (win build now works)