Fixes #1374 Class methods called by hooks cannot accept arguments by reference

Fixes #1374 Class methods called by hooks cannot accept arguments by reference