define MIN/MAX
fix includes
silence warning