Fix hard-coded alloc size.
Add support for zero-argument callbacks.