Added function to identify baton clients to ips.

Fixed bug in freeing memory during tests.