AGAS: Ensure error codes are properly handled by returning from function after error.
Tests: Add a unit test for the get_gid() method of components.