Bug fixes and TTD clean up.