Merged hasufell's helpful ToME4 changes.

Thanks, hasufell!