Fix the typing rules for fp.to_real and fixes to tracing.
Improve the trace messages.