Merged hageldave patch.