Fixed bug in passing arguments to callbacks