Fixing some memory leaks.. still missing one or two somewhere..