Fix some Ruby 1.9 compatibiliy issues

Issue #29