Fixed a bug in filter_restricted_names