Add some debugging goop, work around AMD compiler bugs