Add compatibility for ruby18