Make sure we don't store empty slugs. Fixes #531.