Fix memory corruption
Fix bugs identified by unused variable warning
Add containers library