Bugfixes to slug handling