Added debug checks