Added support for getMaxCapacity with query range