Changed to work with pre-1.9 ruby