Various fixes for the recent rewrotes.