NIBG-699c: fixed count query