Add convenience function for adding the same hook to multiple modes.
Fixed stylistic issues.