Fixing problem in metaclass with class naming inheritance.

Reviewed in https://codereview.appspot.com/84740044/