Fix errors in vulgarity check function