Update with latest thor code