generated scala code + wrapper now compiles; runtime error, anyway (to investigate)