Code formatting in attach_hooks().
Test attach_hooks().