Fixing histogram implementation.