Fixed some warnings and added missing header files