Fixed glue code for callbacks