fixed most errors reported by valgrind
fix compiling problems under centos 5
save
added line number resolver, leaks memory, however.