avoid TypeError when root is nil

When used with `carrierwave-datamapper` it throws exception `TypeError: no implicit conversion of nil into String`.