compatibility changes for ruby 2 [dirty W.I.P]