Added unload, and fixed unitialised valgrind errors