missing includes and general fixes