[mondrian-1216,1252] merge fixes for mondrian-1201,1252 from master

http://jira.pentaho.com/browse/MONDRIAN-1252
http://jira.pentaho.com/browse/MONDRIAN-1216