Make the code compatible with older Ruby versions