Minor fixes to get rid of undefined variable notices