Fix database session bug which results in creation of multiple Thread objects on Gmail.
Fix argument ordering in migraton 056.