[TIMOB-16153] Fixed up the various hook calls to use the correct API and...

... improve error handling.