Remove anonymous function in `init` hook, replace with named function for PHP 5.2 support

Fixes #1