Build fixes, memory leaks, and tizen gdb fix