fix warning with -Wconversion in Agent & Environment