fixes for earlier ruby versions