Histogram bin counts are persistent across attribute changes.

Closes #398
Merge pull request #413 from ChrisBeaumont/398

Histogram bin counts persistent across attribute changes