Fix issues when using clang compiler