Fix unused and uninitialized variables

Fix some minor issues that a coverity scan brought up.