fixing clang warnings and lib errors