circle detect and debug fixes