manual merge of upgrade branch 0.8.1.2