Ensure count is always returned as an integer