fixed several memory leaks
more fixes for 2.1.0
fixed several regressions