Crosstab fixes

Continuation of https://github.com/sages-health/openessence-demo/pull/13