Cleanups and workaround the clang compiler bug.