Implement safe_callback().
Closes #144