fix minor warnings, remove unused local variable, remove unused field