Corrected compilation warnings and errors