Backported changes in commits af2b925989f609c1b063fc4843ce3a2488bac511 and 4b5f0e6c413a7a3f74f82b0c6707501e3ebe0793 to 6-7-stable
Requires rubydora ~> 1.7.4
Fixes #354