add TRACE and other small fixes