fix warnings and errors