Fixed nullpointer exception and wrong transformation
Merge branch 'silvio'
merging latest code from silvio