Bug fix when generating empty histogram