Fix unused variable warnings and linker error.