fixed unused variable.
fixed some warnings.