use childdata ptrs in log.c
fix incorrect index conversion.