fixed commpiler warnings and errors