Some fixes and foundational work for recording, but there are still plenty
of regressions to fix before it's as solid as before...