More robust to_ruby conversion