Wrap beforeExec callback in a pending block
Fix spelling of detach method name