Debug functions fix #18