backport fix for empty bins