fix #278: Trace doesn't work within a subfunction