Fix for Ruby 1.8

Use private_constant only when available.