fixed the TypeError on empty stats - fixes #19