A lot of small fixes.
Added thBase.directx.ComRef.