fix bugs on lib.rb and hpcloud.rb