Cleaning up thrift connections, Fixing some synchronization issues