Fix warnings and errors msgs