Fix memleak
Fix struct mixup