Patches to load under ruby 1.8.x

Note: These changes are purely meant for booting the client under ruby 1.8. These changes might break the client under 1.9.