Removes global assert from the ts; and misc ref adjustments