Debug functions fix