Backported changes from master to 6-7-stable for rubydora 1.7.1+ compatibility

Commits commits af2b925989f609c1b063fc4843ce3a2488bac511 and 4b5f0e6c413a7a3f74f82b0c6707501e3ebe0793 to 6-7-stable

Requires rubydora ~> 1.7.1
Fixes #354