Fixes for getting agent working