[FIX] NULL and 0 record counts in database