Add missing ABC_TRACE_FUNC() statements
Optimize inner loop