Moving to c++ did the trick. Lame that they do not support Python well.