fix warnings and notices