Various fixes to the recent code integration.