Support for joining transactions and some bug fix around ids