Changes required to make compiling with DEBUG work. Apparently someone's debug code doesn't actually compile anymore...