Fixed bug pointed out by David Harvey.