fix warnings and missing includes