Improved ruby 1.9.3 compatibility and resolve: undefined method `empty?' for #<URI::HTTPS