Handle null results better, and defer to the event loop for callbacks

Was failing when res was null