Fix quantities bug