Fix demand calculation.
Merge branch 'master' into gh-pages