Reject invalid slugs

Did some optimisations along the way