Transaction and some tests fix