Ruby implementation: fix syntax error