Possible compile fix

Also removed unneeded variables.