Fixed variable typo :P and hopefully improved mem management
Fixed stupid typo :P