Adding Cory's patch.