fix cancelAfter and its tests
fix duplicate slave tests to wait for the correct detach to complete
Merge branch 'slave-proto' into nine