correct a couple of scan-build identified issues - an uninitialised variable, and some redundant code