added test resulting in NPE when combining count&distinct.