Backported changes in commits af2b925989f609c1b063fc4843ce3a2488bac511 and 4b5f0e6c413a7a3f74f82b0c6707501e3ebe0793 to 6-7-stable
Requires rubydora ~> 1.7.4
Fixes #354
Merge pull request #362 from dchandekstark/issue-354

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