Adding tests, fixing transaction factory and translating