Fixes #3670 - Ruby 1.8 compatible hooks