Logged expection in import_email script
Logged Exception in update_badges script
Fixed some deprecated things and bugs