[reorganization] Updated library.
[reorganization] Corrected some problems valgrind found.