Replaced 'return' with 'last' in Agent loader