Fixes #508

Callback might be undefined.