Fixed second bug pointed out by David Harvey.