Cory: clean up of some bugs in data structure usage in the model.  Still bugs remaining.