bug fixes for email -> email+box migration script