Correct code so tests pass in major MRI versions