fix further mistakes detected by static analyzer