fixed bugs in translation and added actual regression tests. More tests
comming soon.