Fixing bugs in the new renderer (still broken)