Corrected warnings and compiling errors