Fix return if p['total'] is None