Fix agentmodule . closes #1970