Add new template for pref.xml, but only me. Fix other bugs. Add require