Added eval-when to define-hook expansion