Agent fixes

Tests needed