Move more vars into r_frontend_t and squash a few bugs in the process