Make check for `..` more specific.

A `..` anywhere in the classname is invalid.