Syntax, memory leakage

* Fixed more syntax
* Fixed a possible memory leakage