Merge of release/4.0 into dev

'reason' is defined but never used.