Minor modifications to eliminate unused variable and dead code.