Optimized merge function by moving a check out of the loop. Closes #2045.
Removed deprecated percentageDecimals option from demos. Related to #864.