Fix for bug pointed out by DS.