Fixed all last remaining GCC and clang miscompile bugs.