Fix demo.rb generating bug