Fix #10: Allow api.addAgent() to take double or int