Fix old ruby

Made multiple changes that are required for compatibility with ruby 1.9.3. 
#79 should be fixed by this
Yes sorry you are right it seems i missed that.