Fixed slugify.

The slugify() function should fallback to a random string only when the
generated slug is an empty string. Instead, it was always using that method.