Pass the quantities by reference.
Merge branch 'master' into QuantitiesByRef
Merge pull request #199 from pleroy/QuantitiesByRef

Pass the quantities by reference.