start working through memory bugs
fix a clang warning
fix compiler warning