Added tracing, fixed letfn bug