Fix unitialized variable usage and memory leaks in command line and ide.cpp