Unix: Fixing memory access issues in def_main