BUGFIX: stats do not crash on empty documents