fix histogram breaking on empty scanfiles