Implemented for the Python agent, the fix done on 5e41897
Merge branch 'new_agent_fixes'