Fixed execution of detached scripts.