Bug Fixes
Mostly unused variables and memory leaks