Fix crash due to chunk thrashing

Also fixing potential crashes due to TEs loading up in the wrong
dimension, as TE load code was not dimension-aware before this