fix potential bugs found by static analyzer