Imported update from Rubinius.