fix warnings and error