Fix Ruby 1.8.7 compatability.
Now should work also on heroku (for Travis).