Fix TypeError exception in db.py on add activities

Fix TypeError exception: tuple indices must be integers, not str.
Merge pull request #112 from msize/patch-2

Fix TypeError exception in db.py on add activities