fix some warnings, remove unneeded variables