Fix up timeout handling and other callbacks. Add cast and call in.

Add debug to rebar.config.