Minor fixes to get email working in new schema, small bugfixes