Fixed uninitialised variable warnings to silence valgrind.