Debug logging for clone functions