fixed typos and some compilation warnings