Fix for MONDRIAN-1044.  Merge of changes from master:  https://github.com/pentaho/mondrian/commit/6d921bd74b0f826e1dc867eaac4ba4523f9cd1dc