Final fix on Ruby code