Fixes for running on Ruby 1.9.2

Added some fixes for running on 1.9.2.