Fixed some NPE, better transpiling