Attempt 6
Fixed compatibility with ruby 1.9+