Agreed, this code is wrong and messy. I have changed the calls to use ril_template() and generic_cb(). For some reason, part of the Nemo code uses that, and part makes this kind of things. Should have checked more in detail. Some comments below do not apply any more after changing this.