Fix possible uninitialised variable access as advised by Frank.