Added @sezero ’s compile fixes.
Fixed clang issues pointed out by @psi29a