Optimizations to retrorender.c