Check element_name before use.
Check that hooks is Array instance and filter out empty_stanza before running check_hooks.