Cleaned up location of init and free for some programs to prevent memory
leaks on incorrect arguments
13 files changed