Fix for env.rb hooks