Various integration fixes

There were several little problems exposed in the process of integrating
this project with the demo-ehr-rails app.