More fixes from trunk + pull-request 112