Fixing issue which caused the last histogram not to be scaled correctly