Trace

A few bug fixes for builds on 32-bit.