Ruby implementation: minor bug fix