Fix Ruby compatibility issues