Remove unusued variable and fix further compiler warnings.