Fix bug when no traffic for too long
Support for Ruby 1.9.3