Added -g to build scripts
Fixed a minor leak
Fixed a memory allocation error
Fixed iterator initialization
Fixed some memory leaks