Clean up errors and fix API differences in front-end templates.