Updated TestMod

While testing the API using TestMod.py, I discovered numerous bugs.