fixes to errors in delegation docs plus code samples