Fixing various issues with Ruby version of the samples